
/**
 * 防重复点击
 * 使用方法：<el-button icon="search" v-db-click @click="getTableData" type="primary">查询</el-button>
 * */
const dbClick = (el, binding) => {
  el.addEventListener('click', e => {
    if (!el.disabled) {
      el.disabled = true
      el.style.cursor = 'not-allowed'
      setTimeout(() => {
        el.style.cursor = 'pointer'
        el.disabled = false
      }, 1000)
    }
  })
}
export default dbClick;